-
Notifications
You must be signed in to change notification settings - Fork 11
Support orders without price or quantity #103
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Cancelled orders don't have a price or quantity, which leads to failures when converting from protobuf. This allows missing price and quantities. Signed-off-by: cwasicki <[email protected]>
nhatcher-frequenz
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
| or order.price.currency == Currency.UNSPECIFIED | ||
| or order.quantity.mw.is_nan() | ||
| ): | ||
| if od.state_detail.state != OrderState.CANCELED: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would flatten these two if statements
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Found that too difficult to read, but changed it now.
RELEASE_NOTES.md
Outdated
|
|
||
| ## Bug Fixes | ||
|
|
||
| * Add support for cancelled orders that do not have a price or quantity. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would treat this as a bug fix, a more accurate description would be:
* Deal correctly with cancelled orders with no price or quantity
Cancelled orders may not have a price or quantity, all other orders must have these set. Signed-off-by: cwasicki <[email protected]>
Signed-off-by: cwasicki <[email protected]>
Signed-off-by: cwasicki <[email protected]>
Signed-off-by: cwasicki <[email protected]>
5ccdc6a
Signed-off-by: cwasicki <[email protected]>
|
Updated and added test |
This add support for cancelled orders which do not have the price or quantity field set. Since the order field is still valid for cancelled orders and price and quantity fields are not designed as optional, we set the fields to
NaN.In addition to that the headers of the CLI tool are fixed.